// To parse this JSON data, do
//
//     final messageModel = messageModelFromJson(jsonString);

import 'dart:convert';

MessageModel messageModelFromJson(String str) => MessageModel.fromJson(json.decode(str));

String messageModelToJson(MessageModel data) => json.encode(data.toJson());

class MessageModel {
  int id;
  String messageContent;
  int isUser;

  MessageModel({
    required this.id,
    required this.messageContent,
    required this.isUser,
  });

  factory MessageModel.fromJson(Map<String, dynamic> json) => MessageModel(
    id: json["id"],
    messageContent: json["messageContent"],
    isUser: json["isUser"],
  );

  Map<String, dynamic> toJson() => {
    "id": id,
    "messageContent": messageContent,
    "isUser": isUser,
  };

  static List<MessageModel> listFromJson(List jsonList) {
    List<MessageModel> source = [];
    for (var element in jsonList) {
      source.add(MessageModel.fromJson(element));
    }
    return source;
  }
}
